package cn.stylefeng.guns.modular.system.mapper;

import cn.stylefeng.guns.modular.system.controller.dto.TApplicationTask;
import cn.stylefeng.guns.modular.system.entity.IndentOrder;
import cn.stylefeng.guns.modular.system.entity.TApplication;
import cn.stylefeng.guns.modular.system.model.params.TApplicationParam;
import cn.stylefeng.guns.modular.system.model.result.TApplicationResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 *    退款申请
 * </p>
 *
 * @author yl
 * @since 2019-07-09
 */
@Repository
public interface TApplicationMapper extends BaseMapper<TApplication> {

    /**
     * 获取列表
     *
     * @author yl
     * @Date 2019-07-09
     */
    List<TApplicationResult> customList(@Param("paramCondition") TApplicationParam paramCondition);

    /**
     * 获取map列表
     *
     * @author yl
     * @Date 2019-07-09
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TApplicationParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author yl
     * @Date 2019-07-09
     */
    Page<TApplicationResult> customPageList(@Param("page") Page page, @Param("paramCondition") TApplicationParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author yl
     * @Date 2019-07-09
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TApplicationParam paramCondition);


    /**
     * 退款表关联订单表连接查询
     * @return
     */
    List<TApplication> QueryListLiftJoin(@Param("condition") String condition);


    /**
     * 查询详情
     */
    TApplication QueryId(@Param("id") String id);


    /**
     * 修改接口
     */
    String UpdateApplicationId(@Param("type")String type, @Param("remoney")String remoney, @Param("enclosu")String enclosu, @Param("order_id")String order_id, @Param("remarks")String remarks, @Param("id")Integer id);


    //获取关联订货单列表
    Page<List<IndentOrder>> listindentOrder(@Param("id") Long id);


    IPage<TApplicationTask> getDetailById(@Param("page")Page page,@Param("id") Long id);

    TApplication getByProcessInstanceId(String processInstanceId);
}
